<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<script type="text/javascript">
	function userGridRestPassword() {
		var row = userGrid.getRowData();

		if (window.confirm("您确定要重置用户【" + row.fullname + "】的密码为123456吗？")) {
			$.post("app/user/restPassword/" + row.id, function() {
				alert("用户【" + row.fullname + "】密码已经重置为：123456！");
			});
		}

	}
</script>

<isperp:grid gridId="userGrid" url="app/user/list"
	gridTitle="${pageTitle}" cusDialogSize="big" cusFormatterActions="true"
	cusEditUrl="app/user/edit" ondbClickRowEvent="userGrid.edit(rowid);"
	cusDeleteUrl="app/user/delete" excelExportUrl="app/user/excelExport">


	<jsp:attribute name="toolbar">
	<isperp:toolbar id="userToolbar">
	
		<isperp:treeMenu id="userMenu" targetGridId="userGrid">
				<isperp:async enable="true" autoParam="" otherParam="[]"
					url="app/user/userStatusMenu"></isperp:async>
				<isperp:callback onClick="userMenuTree_onNodeClick"
					onAsyncSuccess="userMenuTree_onNodeClickFirst();">
				</isperp:callback>
		</isperp:treeMenu>
	
		<isperp:button icon="icon-plus" text="新增" onclick="userGrid.create();"></isperp:button>
		<isperp:button icon="icon-plus" text="重置密码"
				onclick="userGridRestPassword();"></isperp:button>
		
	</isperp:toolbar>
	</jsp:attribute>

	<jsp:attribute name="searchbar">	
	<table class="search-table">
		<tbody>
			<tr>
				<td>用户名：</td>
				<td><input type="text" field="name" op="cn">
					</td>
				<td>姓名：</td>
				<td><input type="text" field="fullname" op="cn">
					</td>
			</tr>
		</tbody>
	</table>
	</jsp:attribute>
	<jsp:body>	
	<isperp:column name="id" title="id" hidden="true"></isperp:column>
	<isperp:column name="appDepartmentId" title="所在部门" width="100">
	</isperp:column>
	<isperp:column name="code" title="编号" width="100">
	</isperp:column>
	<isperp:column name="name" title="用户名" width="100">
	</isperp:column>
	<isperp:column name="fullname" title="姓名" width="100">
	</isperp:column>
	<isperp:column name="gender" title="性别" width="50">
	</isperp:column>
	<isperp:column name="email" title="邮箱地址" width="150">
	</isperp:column>
	<isperp:column name="position" title="职位" width="60">
	</isperp:column>
	<isperp:column name="tel" title="电话" width="100">
	</isperp:column>
	<isperp:column name="mobile" title="移动电话" width="100">
	</isperp:column>
	
	</jsp:body>
</isperp:grid>

